#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <stdbool.h>
#include <time.h>

typedef int HPDateType;

typedef struct Heap
{
	HPDateType* a;
	int size;
	int capacity;
}HP;

void HeapInit(HP* php);
void HeapDesTroy(HP* php);

void HeapPush(HP* php, HPDateType x);
void HeapPop(HP* php);

HPDateType HeapTop(HP* php);
size_t HeapSize(HP* php);
bool HeapEmpty(HP* php);

void AdjustUp(HPDateType* a, int child);
void AdjustDown(HPDateType* a, int size, int parent);
void Swap(HPDateType* p1, HPDateType* p2);